import Vue from 'vue'
import Router from 'vue-router'
import DataLink from '@/view/DataLink'
import BaseLink from "@/view/BaseLink"
import DataView from "@/view/DataView"
import Login from "@/view/Login"
import addModel from "@/view/addModel"
import Manage from "@/view/Manage"
import ProMan from "@/view/ProMan"
import ManageStatelist from "@/view/ManageStatelist"
import Maintenance from "@/view/Maintenance"
import DecSetting from "@/view/DecSetting"
import MysqlDecSetting from "@/view/MysqlDecSetting"
import DataModel from "@/view/DataModel"
import addModelFiled from "@/view/addModelFiled"
import mysql from "../components/MySQL"

import excel from "../components/Excel"
import oracle from "../components/Oracle"
import csv from "../components/Csv"
import txt from "../components/Txt"
import hive from "../components/MapRHive"
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'DataLink',
       redirect:"/dataView"
    },
    {
      path: '/datalink',
      name: 'DataLink',
      component: DataLink,
      children:[
        {
          path: 'baselink',
          name: 'BaseLink',
          component:BaseLink,
          children:[
            {
              path: 'mysql',
              name: 'mysql',
              component:mysql
            },
            {
              path: 'excel',
              name: 'excel',
              component:excel
            },
            {
              path: 'oracle',
              name: 'oracle',
              component:oracle
            },
            {
              path: 'csv',
              name: 'csv',
              component:csv
            },
            {
              path: 'txt',
              name: 'txt',
              component:txt
            },{
              path: 'hive',
              name: 'hive',
              component:hive
            },

          ]
        },
        {
          path: 'decsetting',
          name: 'DecSetting',
          component:DecSetting
        },
        {
          path: 'mysqlDecSetting',
          name: 'MysqlDecSetting',
          component:MysqlDecSetting
        }
      ]
    },
    {
      path: '/dataView',
      name: 'DataView',
      component:DataView
    },
    {
      path: '/addModel',
      name: 'addModel',
      component:addModel
    },
    {
      path: '/addModelFiled',
      name: 'addModelFiled',
      component:addModelFiled
    },
    {
      path: '/dataModel',
      name: 'DataModel',
      component:DataModel
    },
    {
      path: '/maintenance',
      name: 'Maintenance',
      component:Maintenance
    },
    {
      path: '/proman',
      name: 'ProMan',
      component:ProMan,
      children:[
        {
          path: 'manage',
          name: 'Manage',
          component:Manage
        },
        {
          path: 'manageStatelist',
          name: 'ManageStatelist',
          component:ManageStatelist
        },
      ]
    },
    
    {
      path: '/login',
      name: 'Login',
      component:Login
    }
  ]
})
